home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / AIncludes / QD3DExtension.a < prev    next >
Encoding:
Text File  |  1998-04-09  |  8.7 KB  |  317 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3DExtension.a
  3. ;
  4. ;    Contains:    QuickDraw 3D Plug-in Architecture     Interface File.                                
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    QuickTime 3.0
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QD3DEXTENSION__') = 'UNDEFINED' THEN
  19. __QD3DEXTENSION__ SET 1
  20.  
  21.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  22.     include 'QD3D.a'
  23.     ENDIF
  24.     IF &TYPE('__QD3DERRORS__') = 'UNDEFINED' THEN
  25.     include 'QD3DErrors.a'
  26.     ENDIF
  27.  
  28. ; ******************************************************************************
  29. ; **                                                                             **
  30. ; **                                Constants                                      **
  31. ; **                                                                             **
  32. ; ****************************************************************************
  33.  
  34.     IF TARGET_OS_MAC THEN
  35.  
  36. kQ3XExtensionMacCreatorType        EQU        'Q3XT'
  37. kQ3XExtensionMacFileType        EQU        'shlb'
  38.     ENDIF    ; TARGET_OS_MAC
  39.  
  40. ; ******************************************************************************
  41. ; **                                                                             **
  42. ; **                                Object Method types                              **
  43. ; **                                                                             **
  44. ; ****************************************************************************
  45.  
  46.  
  47. kQ3XMethodTypeObjectClassVersion EQU    'vrsn'
  48. ; typedef unsigned long                 TQ3XObjectClassVersion
  49.  
  50.  
  51. kQ3XMethodTypeObjectClassRegister EQU    'rgst'
  52.  
  53. kQ3XMethodTypeObjectClassReplace EQU    'rgrp'
  54.  
  55. kQ3XMethodTypeObjectClassUnregister EQU    'unrg'
  56.  
  57. kQ3XMethodTypeObjectNew            EQU        'newo'
  58.  
  59. kQ3XMethodTypeObjectDelete        EQU        'dlte'
  60.  
  61. kQ3XMethodTypeObjectDuplicate    EQU        'dupl'
  62. ; ******************************************************************************
  63. ; **                                                                             **
  64. ; **                            Object Hierarchy Registration                      **
  65. ; **                                                                             **
  66. ; ****************************************************************************
  67.  
  68. ; *    Q3XObjectHierarchy_RegisterClass
  69. ; *    
  70. ; *    Register an object class in the QuickDraw 3D hierarchy.
  71. ; *    
  72. ; *    parentType            - an existing type in the hierarchy, or 0 to subclass
  73. ; *                            TQ3Object
  74. ; *    objectType            - the new object class type, used in the binary 
  75. ; *                        metafile.  This is assigned at run time and returned
  76. ; *                          to you.
  77. ; *    objectName            - the new object name, used in the text metafile
  78. ; *    metaHandler            - a TQ3XMetaHandler (may be NULL for some classes) 
  79. ; *                          which returns non-virtual methods
  80. ; *    virtualMetaHandler    - a TQ3XMetaHandler (may be NULL as well) which returns
  81. ; *                            virtual methods a child would inherit
  82. ; *    methodsSize            - the size of the class data needed (see 
  83. ; *                            GetClassPrivate calls below)
  84. ; *    instanceSize        - the size of the object instance data needed (see 
  85. ; *                            GetPrivate calls below)
  86.  
  87. ;
  88. ; extern TQ3XObjectClass Q3XObjectHierarchy_RegisterClass(TQ3ObjectType parentType, TQ3ObjectType *objectType, char *objectName, TQ3XMetaHandler metaHandler, TQ3XMetaHandler virtualMetaHandler, unsigned long methodsSize, unsigned long instanceSize)
  89. ;
  90.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  91.         IMPORT_CFM_FUNCTION Q3XObjectHierarchy_RegisterClass
  92.     ENDIF
  93.  
  94. ; *    Q3XObjectHierarchy_UnregisterClass
  95. ; *    
  96. ; *    Returns kQ3Failure if the objectClass still has objects 
  97. ; * around; the class remains registered.
  98.  
  99. ;
  100. ; extern TQ3Status Q3XObjectHierarchy_UnregisterClass(TQ3XObjectClass objectClass)
  101. ;
  102.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  103.         IMPORT_CFM_FUNCTION Q3XObjectHierarchy_UnregisterClass
  104.     ENDIF
  105.  
  106. ; *    Q3XObjectHierarchy_GetMethod
  107. ; *    
  108. ; *    For use in TQ3XObjectClassRegisterMethod call
  109.  
  110. ;
  111. ; extern TQ3XFunctionPointer Q3XObjectClass_GetMethod(TQ3XObjectClass objectClass, TQ3XMethodType methodType)
  112. ;
  113.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  114.         IMPORT_CFM_FUNCTION Q3XObjectClass_GetMethod
  115.     ENDIF
  116.  
  117. ; *    Q3XObjectHierarchy_NewObject
  118. ; *    
  119. ; *    To create a new object. Parameters is passed into the 
  120. ; *    TQ3XObjectNewMethod as the "parameters" parameter.
  121.  
  122. ;
  123. ; extern TQ3Object Q3XObjectHierarchy_NewObject(TQ3XObjectClass objectClass, void *parameters)
  124. ;
  125.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  126.         IMPORT_CFM_FUNCTION Q3XObjectHierarchy_NewObject
  127.     ENDIF
  128.  
  129. ; *    Q3XObjectClass_GetLeafType
  130. ; *    
  131. ; *    Return the leaf type of a class.
  132.  
  133. ;
  134. ; extern TQ3ObjectType Q3XObjectClass_GetLeafType(TQ3XObjectClass objectClass)
  135. ;
  136.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  137.         IMPORT_CFM_FUNCTION Q3XObjectClass_GetLeafType
  138.     ENDIF
  139.  
  140. ; *    Q3XObjectClass_GetVersion
  141. ; *    This routine obtains the the version of a class, referenced by an
  142. ; *    object class type.  Functions for getting the type are in QD3D.h,
  143. ; *    if you have the class name.
  144.  
  145. ;
  146. ; extern TQ3Status Q3XObjectHierarchy_GetClassVersion(TQ3ObjectType objectClassType, TQ3XObjectClassVersion *version)
  147. ;
  148.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  149.         IMPORT_CFM_FUNCTION Q3XObjectHierarchy_GetClassVersion
  150.     ENDIF
  151.  
  152. ; *    Q3XObjectClass_GetType 
  153. ; *
  154. ; *    This can be used to get the type, given a reference 
  155. ; *    to a class.  This is most useful in the instance where you register a 
  156. ; *    an element/attribute and need to get the type.  When you register an
  157. ; *    element, QD3D will take the type you pass in and modify it (to avoid
  158. ; *    namespace clashes).  Many object system calls require an object type
  159. ; *    so this API call allows you to get the type from the class referernce
  160. ; *    that you will ordinarily store when you register the class.
  161.  
  162. ;
  163. ; extern TQ3Status Q3XObjectClass_GetType(TQ3XObjectClass objectClass, TQ3ObjectType *theType)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  166.         IMPORT_CFM_FUNCTION Q3XObjectClass_GetType
  167.     ENDIF
  168.  
  169.  
  170. ;
  171. ; extern TQ3XObjectClass Q3XObjectHierarchy_FindClassByType(TQ3ObjectType theType)
  172. ;
  173.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  174.         IMPORT_CFM_FUNCTION Q3XObjectHierarchy_FindClassByType
  175.     ENDIF
  176.  
  177.  
  178.  
  179. ; *    Q3XObjectClass_GetPrivate
  180. ; *    
  181. ; *    Return a pointer to private instance data, a block of instanceSize bytes, 
  182. ; *    from the Q3XObjectHierarchy_RegisterClass call.
  183. ; *    
  184. ; *    If instanceSize was zero, NULL is always returned.
  185.  
  186. ;
  187. ; extern void *Q3XObjectClass_GetPrivate(TQ3XObjectClass objectClass, TQ3Object targetObject)
  188. ;
  189.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  190.         IMPORT_CFM_FUNCTION Q3XObjectClass_GetPrivate
  191.     ENDIF
  192.  
  193. ; * Return the "TQ3XObjectClass" of an object
  194.  
  195. ;
  196. ; extern TQ3XObjectClass Q3XObject_GetClass(TQ3Object object)
  197. ;
  198.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  199.         IMPORT_CFM_FUNCTION Q3XObject_GetClass
  200.     ENDIF
  201.  
  202.  
  203.  
  204. ; ******************************************************************************
  205. ; **                                                                             **
  206. ; **                    Shared Library Registration Entry Point                      **
  207. ; **                                                                             **
  208. ; ****************************************************************************
  209.  
  210. TQ3XSharedLibraryInfo    RECORD 0
  211. registerFunction         ds.l    1                ; offset: $0 (0)
  212. sharedLibrary             ds.l    1                ; offset: $4 (4)
  213. sizeof                     EQU *                    ; size:   $8 (8)
  214.                         ENDR
  215. ;
  216. ; extern TQ3Status Q3XSharedLibrary_Register(TQ3XSharedLibraryInfo *sharedLibraryInfo)
  217. ;
  218.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  219.         IMPORT_CFM_FUNCTION Q3XSharedLibrary_Register
  220.     ENDIF
  221.  
  222. ;
  223. ; extern TQ3Status Q3XSharedLibrary_Unregister(unsigned long sharedLibrary)
  224. ;
  225.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  226.         IMPORT_CFM_FUNCTION Q3XSharedLibrary_Unregister
  227.     ENDIF
  228.  
  229.  
  230. ; ******************************************************************************
  231. ; **                                                                             **
  232. ; **                                Posting Errors                                  **
  233. ; **                                                                             **
  234. ; **            You may only call these functions from within an extension         **
  235. ; **                                                                             **
  236. ; ****************************************************************************
  237.  
  238. ; *    Q3XError_Post
  239. ; *    
  240. ; *    Post a QuickDraw 3D Error from an extension.
  241.  
  242. ;
  243. ; extern void Q3XError_Post(TQ3Error error)
  244. ;
  245.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  246.         IMPORT_CFM_FUNCTION Q3XError_Post
  247.     ENDIF
  248.  
  249. ; *    Q3XWarning_Post
  250. ; *    
  251. ; *    Post a QuickDraw 3D Warning, from an extension.  Note the warning code you
  252. ; *    pass into this routine must already be defined in the table above.
  253.  
  254. ;
  255. ; extern void Q3XWarning_Post(TQ3Warning warning)
  256. ;
  257.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  258.         IMPORT_CFM_FUNCTION Q3XWarning_Post
  259.     ENDIF
  260.  
  261. ; *    Q3XNotice_Post
  262. ; *    
  263. ; *    Post a QuickDraw 3D Notice, from an extension.  Note the notice code you
  264. ; *    pass into this routine must already be defined in the table above.
  265.  
  266. ;
  267. ; extern void Q3XNotice_Post(TQ3Notice notice)
  268. ;
  269.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION Q3XNotice_Post
  271.     ENDIF
  272.  
  273.  
  274.     IF TARGET_OS_MAC THEN
  275. ; *    Q3XMacintoshError_Post
  276. ; *    
  277. ; *    Post the QuickDraw 3D Error, kQ3ErrorMacintoshError, and the Macintosh
  278. ; *    OSErr macOSErr. (Retrieved with Q3MacintoshError_Get)
  279.  
  280. ;
  281. ; extern void Q3XMacintoshError_Post(OSErr macOSErr)
  282. ;
  283.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  284.         IMPORT_CFM_FUNCTION Q3XMacintoshError_Post
  285.     ENDIF
  286.  
  287.     ENDIF    ; TARGET_OS_MAC
  288.  
  289.     ENDIF ; __QD3DEXTENSION__ 
  290.  
  291.